#include <stdio.h>
#include <stdlib.h>
#include "tree.h"

int main(void)
{
     Tree tree;
     char *str = "RAD#E##B#CFG#H#K#####";   //给的是先序遍历的顺序
     TreeNode *p;

     Init(&tree, '#');
     Create(&tree, str);
     PreOrder(tree.root);
     printf("\n");
     p = Find(&tree, 'D');
     if (p == NULL)
          printf("未找到！\n");
     p = Parent(&tree, p);

     if (p != NULL)
          printf("父节点为：%c\n", p->data);
     else
          printf("未找到父结点");

     return 0;
}
